import { PureComponent } from "react"
import UseStoreHOC from "./index"
class Com2 extends PureComponent {
  render() {
    const { onAdd, age } = this.props
    return (
      <div>
        <div>Com2:{age}</div>
        <div>
          <button
            onClick={() => {
              onAdd(-1)
            }}
          >
            -1
          </button>
          <button
            onClick={() => {
              onAdd(-2)
            }}
          >
            -2
          </button>
          <button
            onClick={() => {
              onAdd(-5)
            }}
          >
            -5
          </button>
        </div>
      </div>
    )
  }
}
export default UseStoreHOC(Com2)
